<@override name="widget-box">
<script type="text/javascript" src="${ctx}/assets/back/js/email-utils.1.0.js"></script>
<div id="forgot-box" class="visible widget-box no-border">
		<div class="widget-body">
		 <div class="widget-main">
			<h4 class="header red lighter bigger">找回密码</h4>
			<div class="space-6"></div>
				 <fieldset>
					<label>
						<span class="block input-icon input-icon-right">
							<input  autocomplete="off"   type="email" name="email" class="span12" placeholder="请输入注册时的邮箱账号" />
							<i class="icon-envelope"></i>
						</span>
					</label>
					 <div class="row-fluid" >
                              <span class="i-cue hidden" name="emailMsg" ></span>
                               <span class="password-hyperlink hidden" name="enterMail"><a name="redirectEmail"  onclick="">进入邮箱</a></span>
                      </div>
                      <div class="toolbar center clearfix">
                        <a class="sendemail" href="${ctx}/settings/password/reset">确认</a>
                     </div>
					<div class="row-fluid">
						<a href="${ctx}/login" class="btn btn-small btn-primary btn-forword btn-return" style="text-shadow:none!important;">返回登录 <i class="icon-arrow-right"></i></a>
					</div>
				  </fieldset>
		 </div><!--/widget-main-->
		
		</div><!--/widget-body-->
	</div><!--/forgot-box-->
</@override>
<@extends name="/login.ftl"/>
<script type="text/javascript">
$(function(){
	$(".sendemail").click(function() {
		var _param = $("input[name='email']").serialize();
		var _href = $(this).attr("href");
		
		$.get(_href, _param, function(data) {
			if(data.status =="ok"){
				$("span[name='emailMsg']").removeClass("hidden").text(data.msg);
				$("span[name='enterMail']").removeClass("hidden");

				var ownMail ="http://"+ Email.toAddr($("input[name='email']").val());
				$("a[name='redirectEmail']").attr({"href":ownMail,"target":"_block"});

			}else if(data.status=="false"){
				$("span[name='emailMsg']").removeClass("hidden").text(data.msg);
				$("span[name='enterMail']").addClass("hidden");
			}else{
				$("span[name='emailMsg',name='enterMail']").addClass("hidden");
			}
			
			
		});
		return false;
	});
});
</script>